
#pragma once

#include "BinaryTree.h"
#include "ttg/services.h"
#include <vector>

//Serial version of tree summator. Return result + elapsed time.
template <class T>
std::pair<T, double> serialTreeSum(BinaryTree<T> *tree)
{
	double t_start = ttg::services::ServiceBase::_Timer().getSeconds();
	T res = tree->getSum();
	double t_end = ttg::services::ServiceBase::_Timer().getSeconds();
	return std::pair<T, double>(res, t_end - t_start);
}
